#include<bits/stdc++.h>

using namespace std;
//大整数的逆序存储：vector优点：容量动态增加,方便尾部增加删除,
int main() {
    vector<int> a = {3, 2, 1};//123
    int y = 9;
    for (int i = 0; i < a.size(); i++) {
        a[i] *= y;
    }
    int cs = 0;
    for (int i = 0; i < a.size(); i++) {
        int temp = a[i] + cs;
        cs = temp / 10;
        a[i] = temp % 10;
    }
    while (cs > 0) {
        a.push_back(cs % 10);
        cs /= 10;
    }
    copy(a.rbegin(), a.rend(), ostream_iterator<int>(cout, " "));

    return 0;
}
